#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPen>
#include <QTableWidget>
#include "qcustomplot.h"
#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    bool event(QEvent *mEvent);
    QTableWidget* table, *splineTable;
    void countFunc(QString function, double x0, double xn, int n,  QVector<double>& x,  QVector<double>& y, QVector<double>& yDiff, QVector<double>& ySecondDiff);
    void plotFunc(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));
    void plotFunc2(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:

    void on_pushButton_3_clicked();

    void on_pushButton_loadValues_clicked();

    void on_pushButton_2_clicked();

    void on_horizontalSlider_valueChanged(int value);

    void on_pushButton_Rescale_clicked();

    void updateNumberForTau();

    void updateSR();

    void on_spinBox_3_valueChanged(int arg1);

    void on_radioButton_1_clicked();

    void on_radioButton_4_clicked();

    void on_radioButton_3_clicked();

    void on_radioButton_2_clicked();

private:
    Ui::MainWindow *ui;
    QCustomPlot* difference;

    int n;
    double T,t,tau,h,lambda1,lambda2,ro,c,gamma,k,nu;

    QVector<double> x, u1, u2, u1_new, u2_new;
    int currentIter;
    QTimer *timer;
};

#endif // MAINWINDOW_H
